package com.msite.web;

import com.github.pagehelper.PageHelper;
import com.msite.mapper.SysUserMapper;
import com.msite.model.SysUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by tpeng on 2016/5/14.
 */
@Controller
public class TestAController {

    @Resource
    SysUserMapper sysUserMapper;

    @RequestMapping(value = "/login_")
    public String login_(ModelMap model, HttpServletRequest request, HttpSession session){
        Map<String,Object> pmap = new HashMap<>();
        pmap.put("username", "username1");
        pmap.put("ResultMap", "com.msite.mapper.SysPermMapper.perm123");
        pmap.put("sql", "select * from t_sys_user where username=#{username}");
        PageHelper.startPage(1, 13);
        List<SysUser> list  = sysUserMapper.getTestBy(pmap);
        System.out.println(list);
        return "/login";
    }


}
